Skip to content

Conversation

CodeMasterYi
Copy link

@CodeMasterYi CodeMasterYi commented Dec 16, 2021

Update native sdk version to latest & refactor iOS adapter!

before google's future new release(greater than 1.0.4 released in 2018), you guys can
try import this. [email protected]
It depends on EDM4U(aka. unity-jar-resolver).

https://github.com/CodeMasterYi/google-signin-unity/releases

Update 2025-08-14!!!

  1. Change iOS version to = 6.2.4!
  2. Do like this Change GTMSessionFetcher/Core from <3.0 to '<4.0' CocoaPods/Specs#14617, under ~/.cocoapods/repos/cocoapods/Specs/d/4/0/GoogleSignIn/6.2.4/GoogleSignIn.podspec.json
  3. I will upgrade the ios part to v8+ or even v9+ in the near future

Copy link

@collectivemass collectivemass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on iOS and works great! Many thanks

@CodeMasterYi
Copy link
Author

Tested on iOS and works great! Many thanks

Would you fire a new release?

@collectivemass
Copy link

collectivemass commented Oct 27, 2022 via email

@CodeMasterYi
Copy link
Author

I don't work for Google, can I do that?

On Thu, Oct 27, 2022 at 12:29 AM Spermoverflow @.> wrote: Tested on iOS and works great! Many thanks Would you fire a new release? — Reply to this email directly, view it on GitHub <#205 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALIT6YXYJDKFRSKV6DKDP3WFIVMPANCNFSM5KFHXUMA . You are receiving this because you commented.Message ID: @.>
-- Roger Miller | Collective Mass | 424 603 7827

Aha. I mistakenly thought you work for Google~

@karstenkx
Copy link

karstenkx commented Dec 14, 2022

This could help me and my guys but I have a hard time to build this, I am not much in Java anymore since C# exists, can anyone tell me what to do to build this? I tried on Windows WSL 2 and got the below error.

winux@MSIGF63:~/gis/google-signin-unity$ ./build_all.sh --scan
~/gis/google-signin-unity ~/gis/google-signin-unity

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.17'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
~/gis/google-signin-unity
winux@MSIGF63:~/gis/google-signin-unity$ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java
Nothing to configure.
winux@MSIGF63:~/gis/google-signin-unity$

thanks for any help

Edit1: After following this guide https://www.javaprogramto.com/2021/11/could-not-determine-java-version.html
I stuck now with

winux@MSIGF63:~/gis/google-signin-unity$ ./build_all.sh --scan
~/gis/google-signin-unity ~/gis/google-signin-unity

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':native-googlesignin'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
~/gis/google-signin-unity
winux@MSIGF63:~/gis/google-signin-unity$

gradle version is at 5.4.1

About that sdk issues there is an addon to the readme in this fork https://github.com/wakawa2003/google-signin-unity-fixed
It would be really great if someone could build this and put it somewhere to download for everyone

@CodeMasterYi
Copy link
Author

CodeMasterYi commented Dec 16, 2022

This could help me and my guys but I have a hard time to build this, I am not much in Java anymore since C# exists, can anyone tell me what to do to build this? I tried on Windows WSL 2 and got the below error.

winux@MSIGF63:~/gis/google-signin-unity$ ./build_all.sh --scan
~/gis/google-signin-unity ~/gis/google-signin-unity

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.17'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
~/gis/google-signin-unity
winux@MSIGF63:~/gis/google-signin-unity$ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java
Nothing to configure.
winux@MSIGF63:~/gis/google-signin-unity$

thanks for any help

Edit1: After following this guide https://www.javaprogramto.com/2021/11/could-not-determine-java-version.html I stuck now with

winux@MSIGF63:~/gis/google-signin-unity$ ./build_all.sh --scan
~/gis/google-signin-unity ~/gis/google-signin-unity

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':native-googlesignin'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
~/gis/google-signin-unity
winux@MSIGF63:~/gis/google-signin-unity$

gradle version is at 5.4.1

About that sdk issues there is an addon to the readme in this fork https://github.com/wakawa2003/google-signin-unity-fixed It would be really great if someone could build this and put it somewhere to download for everyone

So sorry for the inconvenience.
But you should not build it yourself and you can do following this:

  1. import package @ here first https://github.com/googlesamples/google-signin-unity/releases/tag/v1.0.4
  2. modify the files that included in this PR

If it works, it would be nice to let me know. @karstenkx

@karstenkx
Copy link

karstenkx commented Dec 17, 2022

If it works, it would be nice to let me know. @karstenkx

Yes, in the end It worked when I installed that stone old "latest" release and then use the files in your PR , put them into the project overwritting , we both know a proper build and package release would be better

@CodeMasterYi
Copy link
Author

If it works, it would be nice to let me know. @karstenkx

Yes, in the end It worked when I installed that stone old "latest" release and then use the files in your PR , put them into the project overwritting , we both know a proper build and package release would be better

@karstenkx
I'm sorry for that.
I havent tried to rebuild a new package release.
I dont work for google.
I just provide a patch fix for some else to work around the not up to date issue.
If you have time to do so, that would be wonderful.
Nice day!

@MrKhan2022
Copy link

Guy i need a help i am getting this error
'GoogleSignIn/GIDAuthentication.h' file not found
Screenshot 2022-12-19 at 6 08 44 PM

@MrKhan2022
Copy link

Guy i need a help i am getting this error 'GoogleSignIn/GIDAuthentication.h' file not found Screenshot 2022-12-19 at 6 08 44 PM

image

@Crazak
Copy link

Crazak commented Dec 19, 2022

Having the same issue as @MrKhan2022. I'm pretty sure it was working a few days ago. Any help would be appreciated.

Edit: If anyone still struggling with this, changing the dependency version from >=6.0.2 to =6.2.4 solved it for me.

@CodeMasterYi
Copy link
Author

CodeMasterYi commented Dec 22, 2022

Having the same issue as @MrKhan2022. I'm pretty sure it was working a few days ago. Any help would be appreciated.

Edit: If anyone still struggling with this, changing the dependency version from >=6.0.2 to =6.2.4 solved it for me.

@Crazak Glad to hear that you have work around the issue.

Edit: May I have your unity version and xcode version(with macos version)?

@MrKhan2022
Copy link

Unity Version: 2021.3.8f1
Xcode version: 13.2.1
MacOs: macOS Big Sur version 11.7.1
@CodeMasterYi

@Amrazyan
Copy link

Amrazyan commented Jan 1, 2023

Guys please help me, still getting error like @MrKhan2022 described

@Amrazyan
Copy link

Amrazyan commented Jan 1, 2023

Screen Shot 2023-01-01 at 12 41 24

.

@CodeMasterYi
Copy link
Author

Guys please help me, still getting error like @MrKhan2022 described

I cant find clientID, uiDelegate and delegate in my implementation.

@CodeMasterYi
Copy link
Author

[email protected]
@Amrazyan unzip this file and try import this unity package that modified by me.

@matbn
Copy link

matbn commented Jan 10, 2023

Hi, I'm trying to build this, but I'm having a similar error to MrKhan, but in my case is another file (GIDSignIn), I've tried creating a new project and importing everything cited on this thread, but it still happens, even switch from 6.0.2 to 6.2.4.
I'm testing using the latest xcode with macOS Ventura, with an apple M1.
I'm not using Firebase, just the GoogleSignIn.

image

@CodeMasterYi
Copy link
Author

Hi, I'm trying to build this, but I'm having a similar error to MrKhan, but in my case is another file (GIDSignIn), I've tried creating a new project and importing everything cited on this thread, but it still happens, even switch from 6.0.2 to 6.2.4. I'm testing using the latest xcode with macOS Ventura, with an apple M1. I'm not using Firebase, just the GoogleSignIn.

image

hi, @matbn
do you delete what you import before and then import the .unitypackage provided in this thread?

@matbn
Copy link

matbn commented Jan 11, 2023

@CodeMasterYi yes, and I've also tried with a fresh project too, just importing the plugin-1.0.4, your files and the sample scene

@CodeMasterYi
Copy link
Author

CodeMasterYi commented Jan 12, 2023

@CodeMasterYi yes, and I've also tried with a fresh project too, just importing the plugin-1.0.4, your files and the sample scene

[email protected] @Amrazyan unzip this file and try import this unity package that modified by me.

hi @matbn
what about only importing the .unitypackage file provided in this thread?
this package is exported from my project which is working well.

one more thing, it depends this plugin https://github.com/googlesamples/unity-jar-resolver/releases/tag/v1.2.175
and this plugin depends on cocopods which downloads the remote dependencies on iOS Player.

@matbn
Copy link

matbn commented Jan 13, 2023

@CodeMasterYi using only your package with the jar resolver I could build, thank you for the help and for the updates.
I still haven't tried the sign-in cause I'm having a little problem with the plist thing (kinda new to apple), but will update after fix this.

@CodeMasterYi
Copy link
Author

@matbn Glad to hear that.
If there is any problem about this package, let me know.

@DhawalJhaveri
Copy link

DhawalJhaveri commented Sep 25, 2025

@CodeMasterYi Cant seem to figure out the exact issue. I'll keep looking till I figure it out. Also please share the link to the site in the third image.

@CodeMasterYi
Copy link
Author

@CodeMasterYi Cant seem to figure out the exact issue. I'll keep looking till I figure it out. Also please share the link to the site in the third image.

Do you mean this?
https://developer.android.com/guide/practices/page-sizes#windows-powershell_1

@CodeMasterYi
Copy link
Author

CodeMasterYi commented Sep 25, 2025

@DhawalJhaveri You should ensure that the libarary is included in the package.
One possible tip:
Maybe that was ignored by VCS(such as Subversion) when you uploading the imported plugin and you build on another device without that library.

@DhawalJhaveri
Copy link

DhawalJhaveri commented Sep 25, 2025

@CodeMasterYi I used the APK analyzer in Android Studio to check if the APK was including the Google Sign-in package but there was nothing related to it. The libs/arm64-v8a is missing the libnative-googlesignin.so file in the APK. This might be the reason why I'm getting the said error.

@BloodIcee
Copy link

@Thaina hi again. Removed GoogleSignIn, EDM. Imported yours with UPM. Resolved and now I cannot build my game. Unity version is 2022.3.44f1. Here is the error:
Note: ***\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Could not load custom lint check jar file ***.gradle\caches\transforms-3\cae55797de2b85017dea1286eb360cde\transformed\jetified-activity-1.8.0\jars\lint.jar
java.lang.UnsupportedClassVersionError: androidx/activity/lint/ActivityIssueRegistry has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
...
Could not load custom lint check jar file ***.gradle\caches\transforms-3\314fa4048d55c7414f5c82d08a7a1ad6\transformed\jetified-annotation-experimental-1.4.1\jars\lint.jar
java.lang.UnsupportedClassVersionError: androidx/annotation/experimental/lint/ExperimentalIssueRegistry has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
...

Is that a problem of JDK?

@Thaina
Copy link

Thaina commented Sep 26, 2025

I'm not sure, let's remove Library folder first

@BloodIcee
Copy link

I deleted Library folder, cleared cache of gradle, reinstalled Unity and project. Still get the same error

@Thaina
Copy link

Thaina commented Sep 26, 2025

Have you clear resolved library and using gradle system in project?

@Bodrihin
Copy link

I deleted Library folder, cleared cache of gradle, reinstalled Unity and project. Still get the same error

In project settings change minimum Api level to 24.
Also change build settings:
Screenshot 2025-09-26 at 14 39 24

@BloodIcee
Copy link

I think so. As I said, I deleted googlesignin, edm and reinstalled project at all. Before I had unitypackage signin. Now I used yours UPM packages. I didn't have LauncherManifest, but had LauncherGradleTemplate

@DhawalJhaveri
Copy link

@CodeMasterYi @Thaina Thanks for all your help, I finally solved the issue. All I had to do was keep the older versions of the plugins that i was using and just update the Unity Editor version. I went from using 6000.0.32f1 to 6000.0.58f1. After updating the editor I tried to add the latest versions of the plugins but was faced with the same issue, but after reverting back to the version where my game was properly working I made a build in 6000.0.58f1 and checked it out in APK analyzer first and then on my android device. Those test confirmed that Google Signin is now working for me.
Once again thank you very much for helping me out.

@CodeMasterYi
Copy link
Author

@BloodIcee Do you explicitly specify JDK version in your build.gradle? How do you build your app? Android Studio or just command line?

@BloodIcee
Copy link

@CodeMasterYi give me some time. I deleted EDM, GoogleSignIn and will reimport UPM again. Let me also add LauncherManifest as Bodrihin said and raise minimum target API to 24
I build game with unity build system

@CodeMasterYi
Copy link
Author

It's a common issue with JDK version.
It tells that you should use JDK 11, but 17 is in use. If you use Android Studio, download a version of openjdk 11 with it, and set to use it.
@BloodIcee

@BloodIcee
Copy link

@CodeMasterYi I use jdk which is installed by Unity. I also installed jdk 17, but it cannot be set in Unity 2022.3

@CodeMasterYi
Copy link
Author

CodeMasterYi commented Sep 26, 2025

@BloodIcee I think you are exporting Android project first? If so:
Set the JDK path to 11.
Maybe it is defined in gradle.properties.
You can search it to find how.

BTW
It's nothing to do with the plugin. And you can ask AI to solve it soon.

@Thaina
Copy link

Thaina commented Sep 27, 2025

@Bodrihin I have try to made a successful build in 2022.3.62f

I need to remove all these file in plugins folder, then regenerate it in 2022.3.62f

image

So, maybe gradle update and credential manager version was the cause? And we might just need newer version of unity to fix it

@romas34
Copy link

romas34 commented Oct 14, 2025

@DhawalJhaveri, please tell me, how you made the plugin work! Help please!
I switched to Unity 6000.0.59f2 (i used ExternalDependencyManager 1.2.186). And now GoogleSignIn plugin is crashing when I click the "google login" button, :(

DllNotFoundException: Unable to load DLL 'native-googlesignin'. Tried the load the following dynamic libraries: Unable to load dynamic library 'native-googlesignin' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "native-googlesignin" not found
at Google.Impl.GoogleSignInImpl.GoogleSignIn_Create (System.IntPtr data) [0x00000] in <00000000000000000000000000000000>:0
at Google.Impl.GoogleSignInImpl..ctor (Google.GoogleSignInConfiguration configuration) [0x00000] in <00000000000000000000000000000000>:0
at Google.GoogleSignIn.get_DefaultInstance () [0x00000] in <00000000000000000000000000000000>:0
at Services.Authentication.GoogleAuthentication.Login () [0x00000] in <00000000000000000000000000000000>:0
at Login.LoginWindow.GoogleLogin () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (Unity

@CodeMasterYi, please help! :)

I tried to remove the plugin and install it as @Thaina wrote, I simply added the dependency to manifest.json.

{
  "dependencies": {
    "com.google.signin": "https://github.com/Thaina/google-signin-unity.git#newmigration",
    ...
  }
}

But that doesn't work either! :( I just don't get the error right away. When I click the "google login" button, I see the native Android window with a list of my Google accounts. When I choose an account to login, application is crashes with 2 errors:

AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/credentials/Credential;
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/credentials/Credential;
at java.lang.reflect.Executable.getParameterTypesInternal(Native Method)
at java.lang.reflect.Method.getParameterTypes(Method.java:186)
at java.lang.Class.getDeclaredMethods(Class.java:1884)
at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:25)
at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method)
at com.unity3d.player.ReflectionHelper.-$$Nest$smnativeProxyInvoke(Unknown Source:0)
at com.unity3d.player.P.invoke(Unknown Source:22)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy8.onAuthenticated(Unknown Source)
at com.google.googlesignin.GoogleSignInHelper$1$4.then(GoogleSignInHelper.java:199)
at com.google.googlesignin.GoogleSignInHelper$1$4.then(GoogleSignInHelper.java:190)
at com.google.android.gms.tasks.zzo.run(com.google.android.gms:play-services-tasks@@1

and then

NullReferenceException: Object reference not set to an instance of an object.
at Google.Impl.GoogleSignInImpl.GoogleSignIn_Result (System.Runtime.InteropServices.HandleRef self) [0x00000] in <00000000000000000000000000000000>:0
at Google.Impl.NativeFuture.get_Result () [0x00000] in <00000000000000000000000000000000>:0
at Google.Future`1+d__8[T].MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0

I rolled back everything and went back to the original plugin... Please help me fix this!

P.S. External Dependency Manager ->Android Resolver->Force Resolve from Unity editor menu, works successfully.

@Thaina
Copy link

Thaina commented Oct 14, 2025

have you try made clean project with only google signin?
I suspect there could be old file/library still in the project and being used here

@DhawalJhaveri
Copy link

@romas34 All I did was update my Unity Version to 6000.0.58f1 at first then after the new security patch I moved to 6000.0.58f2. Other than that I left all the plugins that I was using as is and it worked fine.

@CodeMasterYi
Copy link
Author

@romas34 unpack your built package(apk or aab file), find out 'libnative-googlesignin.so' under libs folder.

@romas34
Copy link

romas34 commented Oct 14, 2025

@romas34 unpack your built package(apk or aab file), find out 'libnative-googlesignin.so' under libs folder.

no such file!

What's funny is, I just built another project of mine, also in Unity 6000.0.59f2, and everything works! But there's no External Dependency Manager (More precisely, it is included via a Package Manager). I looked at the apk of this project and there is a file libnative-googlesignin.so!

Why wasn't this file included in this project?

@DhawalJhaveri
Copy link

DhawalJhaveri commented Oct 14, 2025

@romas34 Check the settingsTemplate.gradle file and make sure that the Google Sign-in path looks like this url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9. This was an issue we were facing initially when we tried to implement Google Sign-in into our projects. Adding GeneratedLocalRepo made all the difference.

@romas34
Copy link

romas34 commented Oct 14, 2025

@romas34 Check the settingsTemplate.gradle file and make sure that the Google Sign-in path looks like this url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9. This was an issue we were facing initially when we tried to implement Google Sign-in into our projects. Adding GeneratedLocalRepo made all the difference.

Very strange... in the project where everything works, the line is like this:

url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9

In the project where it DOESN'T work, the line is:

url (unityProjectPath + "/Assets/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9

@Thaina
Copy link

Thaina commented Oct 14, 2025

@romas34 Then the problem seem to be about EDM4U and/or it's config

@romas34
Copy link

romas34 commented Oct 14, 2025

@DhawalJhaveri, Thank you so much! I corrected the path in the file and everything worked!
I just don't understand why it turned out this way... Why did it turn out this path... There was such a path just above, and it was the right one:

url (unityProjectPath + "/Assets/GeneratedLocalRepo/Firebase/m2repository") // Assets/Firebase/Editor/AppDependencies.xml:22, Assets/Firebase/Editor/MessagingDependencies.xml:24

but the path to GoogleSignIn did not contain GeneratedLocalRepo... strangely

@Thaina , @CodeMasterYi Thank you very much for your help!

@CodeMasterYi
Copy link
Author

CodeMasterYi commented Oct 14, 2025

@romas34 Just like its name, GeneratedLocalRepo is generated by EDM4U. You should never be supposed to change the auto-generated content in your project.

@romas34
Copy link

romas34 commented Oct 14, 2025

@romas34 Just like its name, GeneratedLocalRepo is generated by EDM4U. You should never be supposed to change the auto-generated content in your project.

Maybe I misunderstood something, but I just corrected the path in the settingsTemplate.gradle file.

@jeremytm
Copy link

@romas34 and others, every time we needed to update something—e.g. most recently it was updating Firebase packages for 16KB Page Size support in Google Play—we would also run into compatibility issues with this package.

This time, we tasked GPT-5 in Cursor to look over this plugin, and write a replacement specific to our project. Took a few iterations and builds to get working, but all is working well. Just be sure to specify you want native google sign-in (not web), and ensure it makes changes in the main project's xml dependency files, not in the build folder (for iOS) so that these changes stick between builds.

Now in the future we won't have to faff around with the same old compatibility problems that arise from this plug-in.

@DhawalJhaveri
Copy link

@romas34 that issue is most probably related to the force resolve we perform before making a build for Android. We had to go through a lot of trial and errors to get it right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.